home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Aventura / TheBearsAdventure.swf / scripts / frame_6 / PlaceObject2_1458_267 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2005-08-04  |  3.0 KB  |  93 lines

  1. onClipEvent(enterFrame){
  2.    if(_visible)
  3.    {
  4.       switch(sost)
  5.       {
  6.          case 2:
  7.             if(!_level0.no_sound)
  8.             {
  9.                _level0.snds[_level0.snd_clock_wait].stop();
  10.             }
  11.             if(count >= 64)
  12.             {
  13.                dx = _level0.hero._x - _X;
  14.                dy = _level0.hero._y - _Y;
  15.                dlen = Math.sqrt(dx * dx + dy * dy);
  16.                _X = _X + dx * speed / dlen;
  17.                _Y = _Y + dy * speed / dlen;
  18.             }
  19.          case 0:
  20.             count++;
  21.             if(count >= 172)
  22.             {
  23.                sost = 1;
  24.             }
  25.             break;
  26.          case 1:
  27.             if(_currentframe < 172)
  28.             {
  29.                gotoAndPlay(172);
  30.             }
  31.             if(_currentframe >= 178)
  32.             {
  33.                ghost_count++;
  34.                if(!_level0.no_sound)
  35.                {
  36.                   _level0.snds[_level0.snd_clock_wait].stop();
  37.                   _level0.snds[_level0.snd_clock_boom].start();
  38.                }
  39.                _level0.monster_ghost.duplicateMovieClip("monster_ghost" + ghost_count,_level0.num_monsters + 600 + ghost_count);
  40.                eval("_level0.monster_ghost" + ghost_count)._x = _X;
  41.                eval("_level0.monster_ghost" + ghost_count)._y = _Y;
  42.                eval("_level0.monster_ghost" + ghost_count).sost = 0;
  43.                eval("_level0.monster_ghost" + ghost_count)._visible = true;
  44.                count = 0;
  45.                sost = 2;
  46.             }
  47.             break;
  48.          case 3:
  49.             if(!_level0.no_sound)
  50.             {
  51.                _level0.snds[_level0.snd_clock_wait].stop();
  52.             }
  53.             if(_currentframe >= 172)
  54.             {
  55.                gotoAndPlay(1);
  56.             }
  57.             dx = _level0.hero._x - _X;
  58.             dy = _level0.hero._y - _Y;
  59.             dlen = Math.sqrt(dx * dx + dy * dy);
  60.             _X = _X - dx * 16 / dlen;
  61.             _Y = _Y - dy * 16 / dlen;
  62.             i = 1;
  63.             while(i <= ghost_count)
  64.             {
  65.                eval("_level0.monster_ghost" + i).sost = 1;
  66.                i++;
  67.             }
  68.             if(_X < 0 || _X > 800 || (_Y < 0 || _Y > 560))
  69.             {
  70.                this.removeMovieClip();
  71.             }
  72.             break;
  73.          case 10:
  74.             if(_Y < 100)
  75.             {
  76.                _Y = _Y + 2;
  77.             }
  78.             else
  79.             {
  80.                sost = 0;
  81.                count = 0;
  82.             }
  83.       }
  84.       if(sost != 3 && sost != 10 && !_level0.hero.immortal && (_level0.hero.sost == 1 || _level0.hero.sost == 2 || _level0.hero.sost == 3) && (_X + 20 >= _level0.hero._x - 27 && _X - 20 <= _level0.hero._x + 25) && (_Y + 32 >= _level0.hero._y - 8 && _Y - 32 <= _level0.hero._y + 28))
  85.       {
  86.          _level0.hero.sost = 9;
  87.          _level0.hero.death_index = 0;
  88.          _level0.hero._xscale = _xscale;
  89.          _level0.hero.gotoAndPlay(_level0.hero.frame_death);
  90.       }
  91.    }
  92. }
  93.